package second;

public class T3_2 {
	public static int[] HeBingArray(int[] a, int[] b) 
	{		
	int[] c = new int[a.length + b.length - cf(a, b) * 2];		
	int index = 0;		
	for (int i = 0; i < a.length; i++) {			
	if (!isExist(b, a[i])) {				
	c[index++] = a[i];			
	}	
	}		
	for (int i = 0; i < b.length; i++) {			
	if (!isExist(a, b[i])) {				
	c[index++] = b[i];			
	}		
	}		
	return c;	}	
	public static int cf(int[] a, int[] b)
	{	int num = 0;		
	for (int i = 0; i < a.length; i++) {			
	if (isExist(b, a[i])) {				
	num++;			
	}		
	}		
	return num;	}	
	public static boolean isExist(int[] a, int s) 
	{	boolean d = false;		
	for (int i = 0; i < a.length; i++) {			
	if (s == a[i]) {				
	d = true;			
	}		
	}		
	return d;	}	
	public static void main(String[] args)
	{		
		int[] a = { 10, 20, 30, 40, 50 };		
		int[] b = { 10, 20, 60 };		
		int[] c = HeBingArray(a, b);		
		for (int i = 0; i < c.length; i++) {			
	System.out.print(c[i] + " ");		}	
		}
	}


